import express from 'express'
import {
  register,
  login,
  authenticate,
  getCurrentUser,
  generateCaptcha,
} from '../controllers/userController.js'

const router = express.Router()

// 公开路由
router.post('/register', register)
router.post('/login', login)
router.get('/captcha', generateCaptcha)

// 需要认证的路由
router.get('/me', authenticate, getCurrentUser)

export default router
